package com.rran.study.algorithm.easy.day11;

/**
 * @author yy
 * @Type Solution.java
 * @Desc
 * @date 2020/12/3
 * 给定一个int数组=[1, 2, 2, 3, 6, 6, 7,7]，按照从小到大顺序排列 实现去重
 */


public class Solution {

    public static void main(String[] args) {
        int[] array = {1, 2, 2, 3, 6, 6, 7,7};
        StringBuilder s = new StringBuilder();
        int a = array[0];
        s.append(a);
        for (int i = 1; i < array.length; i++) {
            if(a!= array[i]){
                s.append(array[i]);
                a = array[i];
            }
        }
        System.out.println(s.toString());
    }
}
